package com.atguigu.flink.datastreamapi.source;

import org.apache.flink.streaming.api.datastream.DataStreamSource;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

/**
 * Created by Smexy on 2022/12/13
 *
 * UnsupportedFileSystemSchemeException: Hadoop is not in the classpath/dependencies.
 */
public class Demo1_File
{
    public static void main(String[] args) throws Exception {

        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();

        env.setParallelism(1);

        //读文件时，可以指定文件的目录，也可以精确到文件
        DataStreamSource<String> dataStreamSource = env.readTextFile("hdfs://hadoop102:9820/input");

        dataStreamSource.print();

        env.execute();

    }
}
